package com.wxy.web.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wxy.web.mapper.RoleMapper;
import com.wxy.web.model.Role;
import com.wxy.web.service.IRoleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wxy
 * @since 2021-06-13
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {
    public Integer insertRolePermission(Integer roleId, Integer permissionId) {
        return this.getBaseMapper().insertRolePermission(roleId,permissionId);
    }

    public Integer deleteRolePermissionByRoleId(Integer roleId) {
        return this.getBaseMapper().deleteRolePermissionByRoleId(roleId);
    }

    public Integer deleteRoleUser(Integer roleId,Integer userId)
    {
        return this.getBaseMapper().deleteRoleUser(roleId,userId);
    }

    public List<Integer> listRoleIdsByUserId(Integer userId)
    {
        return this.getBaseMapper().listRoleIdsByUserId(userId);
    }
}
